<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象扩展</title>
</head>
<body>
</body>
<script type="text/javascript">
    //1. 判断两个值是否完全相等  Object.is   ===
    // let a = 100;
    // let b = 200;
    // console.log(Object.is(a, b));
    // console.log(Object.is(a, 100));
    // console.log(Object.is('100', 100));
    // console.log(NaN === NaN);
    // console.log(Object.is(NaN, NaN));
    
    //2. Object.assign 对象的合并  『场景: 配置文件的合并』
    // let obj = {
    //     a: 100
    // };
    // let obj2 = {
    //     b: 200,
    //     c: 300,
    // }
    // let obj3 = {
    //     a: 500
    // }
    // let res = Object.assign(obj, obj2, obj3);
    // console.log(res);

    //3. 直接修改 __proto__ 设置原型
    let person = {
        type: '人类'
    }

    let me = {
        name: 'xiao-high'
    }

    //修改 me 对象的原型对象
    me.__proto__ = person;

    console.log(me);

</script>
</html>